import {
  http
} from '@/api/service.js'
/**
 * 微信code登录 
 * @param {Object} data - 查询数据
 * @param {Object} params - 查询params参数
 */
export const loginWithCode = (data, params) => {
  return http.middleware({
    method: 'POST', // 必须大写
    url: '/wechat/loginWithCode',
    data: data,
    params: params,
    custom: {
      auth: true
    }
  })
}
/**
 * 绑定手机
 * @param {Object} data - 查询数据
 * @param {Object} params - 查询params参数
 */
export const bindPhone = (data, params) => {
  return http.middleware({
    method: 'POST', // 必须大写
    url: '/wechat/bindPhone',
    data: data,
    params: params,
    custom: {
      auth: true
    }
  })
}
/**
 * 获取用户信息
 * @param {Object} data - 查询数据
 * @param {Object} params - 查询params参数
 */
export const getPersonInfo = (data, params) => {
  return http.middleware({
    method: 'POST', // 必须大写
    url: '/person/getPersonInfo',
    data: data,
    params: params,
    custom: {
      auth: true
    }
  })
}
/**
 * 微信手机号登录
 * @param {Object} data - 查询数据
 * @param {Object} params - 查询params参数
 */
export const addLogin = (data, params) => {
  return http.middleware({
    method: 'POST', // 必须大写
    url: '/wechat/login',
    data: data,
    params: params,
    custom: {
      auth: true
    }
  })
}